<extend name="Layout:layout_edit" />
<block name="body_content_block">
    <form action="{:AddonU('IncomingCall/black_save')}" method="post">
        <table>
            <if condition="$isSuperAdmin">
                <th>租户ID：</th><td><select name="siteID" title="请选择租户" required data-url="{:AddonU('Admin/get_admin_json')}" data-value="{$data.siteID}"></select>
                <else/>
                <tr style="display: none;"><input type="hidden" name="siteID" value="{$loginData.siteID}"/></td></tr>
            </if>
            <tr>
                <th>限制号码：</th><td>
                <input type="text" class="easyui-textbox" name="phoneNumber" placeholder="请输入限制号码" value="{$data.phoneNumber}" title="请填写限制号码!" />
            </td></tr>
            <tr>
                <th>状态：</th><td>
                <input type="radio" name="state" value="1" checked="checked" required />正常
                <input type="radio" name="state" value="0" required />禁用
            </td></tr>
        </table>
        <input type='hidden' value='{$data.id}' name='id' />
    </form>
</block>
<block name="body_after_block"><script>
    ajax_load_options({selector:'select[name="siteID"]', def_option: '选择租户'});
    $('input[name="state"][value="{$data.state}"]').prop('checked', 'checked');    
</script></block>